package com.example.sneakerappforme1105.bean;

import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;


import com.example.sneakerappforme1105.R;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;

//商品信息
@Entity(tableName = "tb_goods"

)
public class Goods implements Serializable {
    @PrimaryKey(autoGenerate = true) // 该字段是自增主键
    @NonNull
    private long goodsId;    // 序号
    private long categoryId ; // 商品类别，外键!!! 要先创建categoryId
    private String name; // 名称
    private String desc; // 描述
    private double price; // 价格
    private String picPath; // 大图的保存路径
    private int picRes; // 大图的资源编号
    private int capcity; // 库存容量
    private String createdAt; // 上架时间
    private String updatedAt; // 最近修改时间
    private int status; // 商品状态 0,1  用于商家操纵

    public Goods(long categoryId, String name, String desc, double price, String picPath, int picRes, String createdAt) {
        this.categoryId = categoryId;
        this.name = name;
        this.desc = desc;
        this.price = price;
        this.picPath = picPath;
        this.picRes = picRes;
        this.createdAt = createdAt;
    }

    public Goods(){

    }

    public long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(long goodsId) {
        this.goodsId = goodsId;
    }

    public long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(long categoryId) {
        this.categoryId = categoryId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    public int getPicRes() {
        return picRes;
    }

    public void setPicRes(int picRes) {
        this.picRes = picRes;
    }

    public int getCapcity() {
        return capcity;
    }

    public void setCapcity(int capcity) {
        this.capcity = capcity;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public String getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(String updatedAt) {
        this.updatedAt = updatedAt;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    private static String[] mNameArray = {
            "FILA Running MIXR", "Jordan Air Jordan1 HighOG “Midnight Navy”","Jordan Stadium",
            "New Balance NB 878","Nike Court Vision Low",
            "Nike Initiator", "PUMA Skye","PUMA Smash Suede","Vans Ward"
    };

    private static String[] mDescArray = {
           "FILA斐乐 Running MIXR'FM碰碰鞋' 织物合成革 运动舒适 低帮 生活休闲鞋 男女同款 黑灰",
            "Jordan Air Jordan 1 High OG “Midnight Navy” 皮革 舒适百搭 高帮 复古篮球鞋 男款 蓝白",
            "Jordan Stadium 90 复古日常 减震 低帮 生活休闲鞋 男款 米棕色",
            "New Balance NB 878 网布翻毛皮 系带 低帮 生活休闲鞋 男女同款 深灰",
            "Nike Court Vision Low 经典款式百搭 低帮 板鞋 女款 白绿",
            "Nike Initiator 轻盈构造 动态支撑 二层牛皮 低帮 休闲跑步鞋 男款 白蓝",
            "PUMA Skye 皮革 街头风 低帮 板鞋 女款 白黑",
            "PUMA Smash Suede 防滑轻便 低帮 板鞋 男款 藏红",
            "Vans Ward 经典款 低帮 板鞋 女款 黑色"};

    private static double[] mPriceArray = {295, 718
            , 409, 449, 281, 294,275,212,240};


    // 声明一个手机商品的大图数组
    private static int[] mPicArray = {
            R.drawable.fila1, R.drawable.jordan1, R.drawable.jordan2,
            R.drawable.newbalance1, R.drawable.nike2, R.drawable.nike1,
            R.drawable.puma1,R.drawable.puma2,R.drawable.vans1};


// 获取默认的手机信息列表
    public static ArrayList<Goods> getDefaultList() {
        ArrayList<Goods> goodsList = new ArrayList<Goods>();
        for (int i = 0; i < mNameArray.length; i++) {
            Goods info = new Goods();
            info.name = mNameArray[i];
            info.desc = mDescArray[i];
            info.price = mPriceArray[i];
            info.picRes = mPicArray[i];
            goodsList.add(info);
        }
        return goodsList;
    }

}

